﻿<!--本文件演示Link如何给cdn样式加本地备用，如何检测cdn样式是否能够正确加载-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - Step4.Unit5</title>
    @* <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> *@
    <!--默认从第三方cdn加载样式，使用类名"alert-warning"类型名测试是cdn是否宕机，如果cdn宕机，就启用本地备用样式资源-->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css"
          asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min1.css"
          asp-fallback-test-class="alert-warning"
          asp-fallback-test-property="color"
          asp-fallback-test-value="#664d03"
    />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/Step4.Unit5.styles.css" asp-append-version="true" />
</head>
<body>
    <header>
        <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
            <div class="container-fluid">
                <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Step4.Unit5</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
                    <ul class="navbar-nav flex-grow-1">
                        <li class="nav-item">
                            <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </header>
    <div class="container">
        <main role="main" class="pb-3">
            @RenderBody()
        </main>
    </div>

    <footer class="border-top footer text-muted">
        <div class="container">
            &copy; 2024 - Step4.Unit5 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
        </div>
    </footer>
    <!--默认模板页，引用了Jquery库-->

    <!--environment 标签助手，用于在不同开发环境下展示不同内容-->
    <environment names="Development">
        <script src="~/lib/jquery/dist/jquery.js"></script>
    </environment>

    <!--environment 标签助手，用于在不同开发环境下展示不同内容-->
    <environment names="Production,Staging">
        <script src="~/lib/jquery/dist/jquery.min.js"></script>
    </environment>
   
    <!--强制刷新-->
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"  asp-append-version="true"></script>
    <!--script的 asp-append-version，强制重新加载文件，不从缓冲中读取文件-->
    <script src="~/js/site.js" asp-append-version="true"></script>
    @await RenderSectionAsync("Scripts", required: false) 
</body>
</html>
